package cn.bouncyslime.graduationProject.nba.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class WebConfig implements WebMvcConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(WebConfig.class);

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        logger.info("==== 添加登陆拦截器 ====");
//        registry.addInterceptor(signInInterceptor)
//                .addPathPatterns("/**")
//                .excludePathPatterns("/userManage/toSignIn", "/userManage/signIn", "/")
//                .excludePathPatterns("/js/**");
//    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
//        //SAVEPATH就是上面的basePath，当请求Url包含static/files/时，就会以文件路径来访问basePath下面的文件
//        registry.addResourceHandler("static/files/**").addResourceLocations("file:" + SAVEPATH);
//        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
    }
}
